{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "sys.version_info(major=3, minor=4, micro=2, releaselevel='final', serial=0)"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import sys\n",
    "sys.version_info"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'1.0.6'"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import petl as etl\n",
    "etl.__version__"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "tbl1 = [['foo', 'bar'],\n",
    "        ['a b c', 1],\n",
    "        ['d e f', 2],\n",
    "        [None, 3]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table class='petl'>\n",
       "<thead>\n",
       "<tr>\n",
       "<th>bar</th>\n",
       "<th>x</th>\n",
       "<th>y</th>\n",
       "<th>z</th>\n",
       "</tr>\n",
       "</thead>\n",
       "<tbody>\n",
       "<tr>\n",
       "<td style='text-align: right'>1</td>\n",
       "<td>a</td>\n",
       "<td>b</td>\n",
       "<td>c</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td style='text-align: right'>2</td>\n",
       "<td>d</td>\n",
       "<td>e</td>\n",
       "<td>f</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td style='text-align: right'>3</td>\n",
       "<td>None</td>\n",
       "<td>None</td>\n",
       "<td>None</td>\n",
       "</tr>\n",
       "</tbody>\n",
       "</table>\n"
      ],
      "text/plain": [
       "+-----+------+------+------+\n",
       "| bar | x    | y    | z    |\n",
       "+=====+======+======+======+\n",
       "|   1 | 'a'  | 'b'  | 'c'  |\n",
       "+-----+------+------+------+\n",
       "|   2 | 'd'  | 'e'  | 'f'  |\n",
       "+-----+------+------+------+\n",
       "|   3 | None | None | None |\n",
       "+-----+------+------+------+"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tbl2 = etl.wrap(tbl1).replace('foo', None, '  ').split('foo', ' ', ['x', 'y', 'z']).replaceall('', None)\n",
    "tbl2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.4.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
